<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .animate{
            position: absolute;
            width: 100px;
            height: 100px;
            background-color: skyblue;
            /* 一起执行 */
            /* animation: animates 4s linear infinite; */
            /* 先执行animate1， 完成以后再执行animate2 */
            animation: animate1 4s linear infinite, animate2 4s linear infinite;
        }

        /* animation: 动画名 动画完成时间 时间函数 延迟时间 播放次数 是否返向播放
                      动画开始或完成时的状态 动画是否正在运行或已暂停; */
        @keyframes animates {
            0%{
                top: 0;
                left: 0;
                width: 100px;
                height: 100px;
                background-color: skyblue;
            }
            25%{
                left: 100px;
                top: 0;
                width: 100px;
                height: 100px;
                background-color: tomato;
            }
            50%{
                left: 100px;
                top: 100px;
                width: 100px;
                height: 100px;
                background-color: red;
            }
            100%{
                top: 100px;
                left: 100px;
                width: 200px;
                height: 200px;
                background-color: red;
            }
        }

        @keyframes animate1 {
            0%{
                top: 0;
                left: 0;
                background-color: skyblue;
            }

            25%{
                left: 100px;
                top: 0;
                background-color: tomato;
            }

            50%{
                top: 100px;
                left: 100px;
                background-color: red;
            }

            100%{
                top: 100px;
                left: 100px;
                background-color: red;
            }
        }

        @keyframes animate2 {
            0%{
                width: 100px;
                height: 100px;
            }

            75%{
                width: 100px;
                height: 100px;
            }

            100%{
                width: 200px;
                height: 200px;
            }
        }
    </style>
</head>
<body>
    <div class="animate"></div>
</body>
</html>